package com.jxwifi.cloud.quickcleanserver.model;

import com.jxwifi.cloud.quickcleanserver.okhttp.AuzHttp;
import com.jxwifi.cloud.quickcleanserver.okhttp.DataJson_Cb;
import com.jxwifi.cloud.quickcleanserver.okhttp.Params;

/**
 * 接口请求统一设置
 */
public class AuzImpl {

    public void auzpost(String UrlPool, Params params, final AuzListener auzListener) {
        AuzHttp.post(UrlPool, params, new DataJson_Cb() {
            @Override
            public void onSuccess(int code, String data) {
                auzListener.AuzSuccess(code, data);
            }

            @Override
            public void onFailure(int errorCode, String msg) {
                auzListener.AuzFailure(errorCode,msg);
            }
        }, "");
    }

    public void auzget(String UrlPool, Params params, final AuzListener auzListener) {
        AuzHttp.get(UrlPool, params, new DataJson_Cb() {
            @Override
            public void onSuccess(int code, String data) {
                auzListener.AuzSuccess(code, data);
            }

            @Override
            public void onFailure(int errorCode, String msg) {
                auzListener.AuzFailure(errorCode,msg);
            }
        }, "");
    }


    public interface AuzListener {

        void AuzSuccess(int code, String data);

        void AuzFailure(int errorCode, String msg);
    }

}
